home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #6 / Amiga Plus CD - 1996 - No. 06.iso / pd / texte / texfontinst / inputs / trig.sty < prev   
Text File  |  1996-07-30  |  3KB  |  99 lines

  1. %% 
  2. %% This is file `trig.sty', generated on <1994/6/22> 
  3. %% with the docstrip utility (2.0r).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% trig.dtx  (with options: `package')
  8. %% 
  9. %% IMPORTANT NOTICE:
  10. %% You are not allowed to distribute this file.
  11. %% For distribution of the original source see
  12. %% the copyright notice in the file trig.dtx .
  13. %% 
  14. %% File: trig.dtx Copyright (C) 1993-1994 David Carlisle
  15. \NeedsTeXFormat{LaTeX2e}
  16. \ProvidesPackage{trig}
  17.          [1994/03/15 v1.07 sin cos tan (DPC)]
  18. \chardef\@xc=90
  19. \chardef\@clxx=180
  20. \chardef\@lxxi=71
  21. \mathchardef\@mmmmlxviii=4068
  22. \chardef\@coeffz=72
  23. \chardef\@coefb=42
  24. \mathchardef\@coefc=840
  25. \mathchardef\@coefd=5040
  26. {\catcode`t=12\catcode`p=12\gdef\noPT#1pt{#1}}
  27. \def\TG@rem@pt#1{\expandafter\noPT\the#1\space}
  28. \def\TG@term#1{%
  29.  \dimen@\@tempb\dimen@
  30.  \advance\dimen@ #1\p@}
  31. \def\TG@series{%
  32.  \dimen@\@lxxi\dimen@
  33.  \divide \dimen@ \@mmmmlxviii
  34.  \edef\@tempa{\TG@rem@pt\dimen@}%
  35.  \dimen@\@tempa\dimen@
  36.  \edef\@tempb{\TG@rem@pt\dimen@}%
  37.  \divide\dimen@\@coeffz
  38.  \advance\dimen@\m@ne\p@
  39.  \TG@term\@coefb
  40.  \TG@term{-\@coefc}%
  41.  \TG@term\@coefd
  42.  \dimen@\@tempa\dimen@
  43.  \divide\dimen@ \@coefd}
  44. \def\CalculateSin#1{{%
  45.   \expandafter\ifx\csname sin(\number#1)\endcsname\relax
  46.     \dimen@=#1\p@\TG@@sin
  47.     \expandafter\xdef\csname sin(\number#1)\endcsname
  48.                                     {\TG@rem@pt\dimen@}%
  49.   \fi}}
  50. \def\CalculateCos#1{{%
  51.   \expandafter\ifx\csname cos(\number#1)\endcsname\relax
  52.     \dimen@=\@xc\p@
  53.     \advance\dimen@-#1\p@
  54.     \TG@@sin
  55.     \expandafter\xdef\csname cos(\number#1)\endcsname
  56.                                      {\TG@rem@pt\dimen@}%
  57.   \fi}}
  58. \def\TG@reduce#1#2{%
  59. \dimen@#1#2\@xc\p@
  60.   \advance\dimen@#2-\@clxx\p@
  61.   \dimen@-\dimen@
  62.   \TG@@sin}
  63. \def\TG@@sin{%
  64.   \ifdim\TG@reduce>+%
  65.   \else\ifdim\TG@reduce<-%
  66.   \else\TG@series\fi\fi}%
  67. \def\UseSin#1{\csname sin(\number#1)\endcsname}
  68. \def\UseCos#1{\csname cos(\number#1)\endcsname}
  69. \chardef\z@num\z@
  70. \expandafter\let\csname sin(0)\endcsname\z@num
  71. \expandafter\let\csname cos(0)\endcsname\@ne
  72. \expandafter\let\csname sin(90)\endcsname\@ne
  73. \expandafter\let\csname cos(90)\endcsname\z@num
  74. \expandafter\let\csname sin(-90)\endcsname\m@ne
  75. \expandafter\let\csname cos(-90)\endcsname\z@num
  76. \expandafter\let\csname sin(180)\endcsname\z@num
  77. \expandafter\let\csname cos(180)\endcsname\m@ne
  78. \def\CalculateTan#1{{%
  79.   \expandafter\ifx\csname tan(\number#1)\endcsname\relax
  80.     \CalculateSin{#1}%
  81.     \CalculateCos{#1}%
  82.     \@tempdima\UseCos{#1}\p@
  83.     \divide\@tempdima\@iv
  84.     \@tempdimb\UseSin{#1}\p@
  85.     \@tempdimb\two@fourteen\@tempdimb
  86.     \divide\@tempdimb\@tempdima
  87.     \expandafter\xdef\csname tan(\number#1)\endcsname
  88.                                         {\TG@rem@pt\@tempdimb}%
  89.   \fi}}
  90. \def\UseTan#1{\csname tan(\number#1)\endcsname}
  91. \mathchardef\two@fourteen=16384
  92. \chardef\@iv=4
  93. \expandafter\def\csname tan(90)\endcsname{\errmessage{Infinite tan !}}
  94. \expandafter\let\csname tan(-90)\expandafter\endcsname
  95.                                        \csname tan(90)\endcsname
  96. \endinput
  97. %% 
  98. %% End of file `trig.sty'.
  99.